﻿@using QDT.Core.Members
<div class="main_title">
    新增会员 <a href="@Url.Action("Index", "User")" class="back_list">返回列表</a></div>
<div class="blank5">
</div>
@using (Html.BeginForm("PostAdd", "User"))
{
    <div class="blank5">
    </div>
    <table class="form">
        <tr>
            <td colspan="2" class="topTd">
            </td>
        </tr>
        <tr>
            <td class="item_title">
                会员类型:
            </td>
            <td class="item_input">
                <select name="UserType">
                    <option value="0" selected="selected">借款人</option>
                    <option value="1">投资人</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="item_title">
                会员名称:
            </td>
            <td class="item_input">
                <input type="text" class="textbox require" name="UserName" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                会员邮件:
            </td>
            <td class="item_input">
                <input type="text" class="textbox require" name="Email" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                手机号:
            </td>
            <td class="item_input">
                <input type="text" class="textbox" name="Mobile" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                登录密码:
            </td>
            <td class="item_input">
                <input type="password" class="textbox require" name="Password" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                确认密码:
            </td>
            <td class="item_input">
                <input type="password" class="textbox require" name="ConfrimPassword" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                会员组:
            </td>
            <td class="item_input">
                <select name="GroupID" id="sltgroup">
                    @foreach (var group in ViewData["UserGroup"] as IList<UserGroup> ?? new List<UserGroup>())
                    {
                        <option value="@group.ID">@group.Name</option>
                    }
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="item_title" style="text-align: center;">
                <b>身份信息</b>
            </td>
        </tr>
        <tr>
            <td class="item_title">
                姓名:
            </td>
            <td class="item_input">
                <input type="text" class="textbox" name="RealName" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                身份证号码:
            </td>
            <td class="item_input">
                <input type="text" class="textbox" name="IDCard" />
            </td>
        </tr>
        <tr id="trCompanyName" class="hide">
            <td class="item_title">
                公司/企业名称:
            </td>
            <td class="item_input">
                <input type="text" class="textbox" name="CompanyName" id="inputCompanyName" style="width: 200px;"  />
            </td>
        </tr>
        <tr id="trCredentials" class="hide">
            <td class="item_title">
                运业证件:
            </td>
            <td class="item_input">
                <input type="text" class="textbox" name="Credentials" id="inputCredentials" style="width: 200px;" />
            </td>
        </tr>
        <tr>
            <td class="item_title">
                出生日期:
            </td>
            <td class="item_input">
                <input type="text" name="BirthYear" class="textbox" value="" style="width: 40px"
                    maxlength="4">
                年
                <input type="text" name="BirthMonth" class="textbox" value="" style="width: 20px"
                    maxlength="2">
                月
                <input type="text" name="BirthDay" class="textbox" value="" style="width: 20px" maxlength="2">
                日
            </td>
        </tr>
        <tr>
            <td class="item_title">
                性别:
            </td>
            <td class="item_input">
                <select name="Sex">
                    <option value="-1">==未选择==</option>
                    <option value="0">女</option>
                    <option value="1">男</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="item_title" style="text-align: center;">
            </td>
        </tr>
        <tr>
            <td class="item_title">
                状态:
            </td>
            <td class="item_input">
                <label>
                    有效<input type="radio" name="IsEffect" value="true" checked="checked" /></label>
                <label>
                    无效<input type="radio" name="IsEffect" value="false" /></label>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="bottomTd">
            </td>
        </tr>
    </table>
    <div class="blank5">
    </div>
    <table class="form" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="2" class="topTd">
            </td>
        </tr>
        <tr>
            <td class="item_title">
            </td>
            <td class="item_input">
                <input type="submit" class="button" value="新增" />
                <input type="reset" class="button" value="重置" />
            </td>
        </tr>
        <tr>
            <td colspan="2" class="bottomTd">
            </td>
        </tr>
    </table>
}
<script type="text/javascript">

    $('#sltgroup').change(function() {
        var sltgroup = $('#sltgroup').val();
        if (sltgroup == 2) {
            $('#trCompanyName').removeClass('hide');
            $('#trCredentials').removeClass('hide');
        } else {
            $('#trCompanyName').addClass('hide');
            $('#inputCompanyName').val('');
            $('#trCredentials').addClass('hide');
            $('#inputCredentials').val('');
        }
    });


</script>
